function addLoadEvent(func) {
    let oldOnload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function () {
            oldOnload();
            func();
        }
    }
}

addLoadEvent(HomeMenu);

addLoadEvent(WaitForYou);

function stopEvent(event) {
    let e = arguments.callee.arguments[0] || event;
    if (window.event) {
        e.cancelBubble = true;
        e.returnValue = false;
    } else if (e && e.stopPropagation) {
        e.stopPropagation();
        e.preventDefault();
    }
}

function HomeMenu() {
    let img = document.getElementsByClassName("img-search");
    let menu = document.getElementsByClassName("bit-header-nav-ul-li-second");
    img[0].onclick = function (e) {
        menu[0].onclick = null;
        menu[0].style.display = "flex";
        menu[0].style.boxShadow = "rgba(128, 128, 128, 0.21) 0px 0px 5.4px 3px"
        menu[0].style.webkitBoxShadow = "rgba(128, 128, 128, 0.21) 0px 0px 5.4px 3px";
        menu[0].style.borderRadius = ".7rem";
        menu[0].style.cursor = "pointer";
        console.log(menu[0].style);
        stopEvent(e);
    }

    document.onclick = function () {
        menu[0].style.display = "none";
        menu[0].style.boxShadow = "0";
        menu[0].style.borderRadius = "0";
    }
}

function WaitForYou() {
    var wait = document.getElementsByClassName("WaitForYou");
    for (var i = 0; i < 2; i++) {
        wait[i].onclick = function (e) {
            alert("该模块将用于教学内容，等你来和我们一起开发");
            stopEvent(e);
        }
    }
    var egg = document.getElementsByClassName("InSearch");
    egg[0].onclick = function (e) {
        alert("该模块开发尚在筹备中");
        stopEvent(e);
    }
}